package com.qf.entity;

import lombok.Data;
import org.omg.CORBA.INTERNAL;

import java.math.BigDecimal;
import java.util.Date;
import java.util.Objects;

@Data
public class Order {

    // 订单ID
    private String id;

    // 用户ID
    private Integer uid;

    // 订单的状态
    private Integer status;

    // 订单创建的时间
    private Date createTime;

    // 支付时间
    private Date payTime;

    // 总价
    private BigDecimal totalPrice;

    // 支付类型
    private Integer payType;

    // 收货人的名字
    private String name;

    // 收货人的地址
    private String address;

    // 时候人手机号
    private String phone;

    public static void main(String[] args) {
        int a = new Order().hashCode();
        int b = new Order().hashCode();
        System.out.println(a);
        System.out.println(b);

        Integer c = 20;
        c.hashCode();

    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Order order = (Order) o;
        return Objects.equals(id, order.id) &&
                Objects.equals(uid, order.uid) &&
                Objects.equals(status, order.status) &&
                Objects.equals(createTime, order.createTime) &&
                Objects.equals(payTime, order.payTime) &&
                Objects.equals(totalPrice, order.totalPrice) &&
                Objects.equals(payType, order.payType) &&
                Objects.equals(name, order.name) &&
                Objects.equals(address, order.address) &&
                Objects.equals(phone, order.phone);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, uid, status, createTime, payTime, totalPrice, payType, name, address, phone);
    }
}
